dai: uaol: add support for Intel UAOL#10567
dai: uaol: add support for Intel UAOL#10567serhiy-katsyuba-intel wants to merge 2 commits intothesofproject:mainfrom
Conversation
c736e45 to
a2901a1
Compare
|
SOFCI TEST |
Updates Zephyr to bring in UAOL support. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Adds support for Intel USB Audio Offload Link (UAOL) DAI. Signed-off-by: Tomasz Lissowski <tomasz.lissowski@intel.com> Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
a2901a1 to
31cfd45
Compare
There was a problem hiding this comment.
Pull request overview
Adds Intel USB Audio Offload Link (UAOL) DAI support across the SOF/Zephyr integration and IPC4 paths, including capability reporting and node-id mapping.
Changes:
- Update West manifest to a Zephyr revision that includes UAOL-related support.
- Introduce the
SOF_DAI_INTEL_UAOLtype and wire it through DAI selection/config paths. - Add UAOL capability advertisement and UAOL stream-id → HDA link stream-id mapping for IPC4 DMA control.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| west.yml | Bumps Zephyr revision required for UAOL enablement. |
| src/lib/dai.c | Registers UAOL devices and maps UAOL to the Zephyr DAI type / DMA caps. |
| src/ipc/ipc4/dai.c | Adds UAOL handling for link config and DMA channel selection. |
| src/include/ipc/dai.h | Introduces SOF_DAI_INTEL_UAOL enum value. |
| src/audio/dai-zephyr.c | Adds UAOL case to Zephyr DAI configuration. |
| src/audio/copier/copier_dai.c | Adds UAOL stream link classes to DAI creation path. |
| src/audio/copier/copier.c | Routes UAOL stream link classes to copier_dai_create(). |
| src/audio/base_fw_intel.c | Advertises UAOL support/caps and maps UAOL node indices for DMA control. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| case ipc4_alh_uaol_stream_link_output_class: | ||
| case ipc4_alh_uaol_stream_link_input_class: | ||
| dai.type = SOF_DAI_INTEL_UAOL; | ||
| dai.is_config_blob = true; | ||
| cd->gtw_type = ipc4_gtw_alh; | ||
| ret = ipc4_find_dma_config(&dai, gtw_cfg_data, gtw_cfg_szie); | ||
| if (ret != IPC4_SUCCESS) { | ||
| comp_err(dev, "No uaol dma_config found in blob!"); | ||
| return -EINVAL; |
There was a problem hiding this comment.
gtw_cfg_szie is very likely a misspelled identifier (expected something like gtw_cfg_size). As written, this will fail to compile unless that exact symbol exists. Rename it to the correct size variable used for the gateway config blob length.
| const size_t dev_count = ARRAY_SIZE(uaol_devs); | ||
| struct uaol_capabilities dev_cap; | ||
| struct ipc4_uaol_capabilities *caps = (struct ipc4_uaol_capabilities *)tuple->value; | ||
| size_t caps_size = offsetof(struct ipc4_uaol_capabilities, link_caps[dev_count]); |
There was a problem hiding this comment.
offsetof(struct ..., link_caps[dev_count]) uses a non-constant array index; this is not valid with standard offsetof/__builtin_offsetof and can fail to compile. Compute the size as sizeof(*caps) + dev_count * sizeof(caps->link_caps[0]) (or the equivalent using the element type) instead.
| size_t caps_size = offsetof(struct ipc4_uaol_capabilities, link_caps[dev_count]); | |
| size_t caps_size = sizeof(*caps) + dev_count * sizeof(caps->link_caps[0]); |
| case SOF_DAI_INTEL_UAOL: | ||
| link_cfg.full = 0; | ||
| link_cfg.part.hchan = gtw_fmt->channels_count - 1; | ||
| link_cfg.part.dir = common_config->direction; | ||
| link_cfg.part.stream = common_config->host_dma_config[0]->stream_id; | ||
| break; |
There was a problem hiding this comment.
hchan is derived as channels_count - 1. If channels_count is 0, this underflows and encodes an invalid hchan value. Clamp or validate the channel count before subtracting (e.g., ensure the minimum encoded value is 0 and only subtract when channels_count > 0).
|
@serhiy-katsyuba-intel I assuming CI will test this now ? |
Adds support for Intel USB Audio Offload Link (UAOL) DAI.
This is a revival of the old closed UAOL PR #9227.
Zephyr PR zephyrproject-rtos/zephyr#104137 is now merged.